package com.liu.project.service.impl;

import com.liu.project.dao.UserCollectionMapper;
import com.liu.project.pojo.UserCollection;
import com.liu.project.service.UserCollectionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: project
 * @description: 收藏操作
 * @author: 86187
 * @create: 2022-03-02 11:03
 **/

@Service
public class UserCollectionServiceImpl  implements UserCollectionService {

    @Resource
    UserCollectionMapper userCollectionMapper;

    @Override
    public List<UserCollection> findAllByUid(int uid) {
        return userCollectionMapper.findAllByUid(uid);
    }

    @Override
    public boolean insertCollection(int uid, int certificateId) {
        int i = userCollectionMapper.insertCollection(uid,certificateId);
        return i>0;
    }

    @Override
    public boolean deleteCollection(int id) {
        int i = userCollectionMapper.deleteCollection(id);
        return i>0;
    }


}
